package top.itmeans.yes.portal.service;

import org.springframework.transaction.annotation.Transactional;
import top.itmeans.yes.entity.MemberReceiveAddress;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 会员收货地址表 服务类
 * </p>
 *
 * @author Yiming.Cao
 * @since 2022-04-28
 */
public interface MemberReceiveAddressService extends IService<MemberReceiveAddress> {
    /**
     * 添加收货地址
     */
    int add(MemberReceiveAddress address);

    /**
     * 删除收货地址
     * @param id 地址表的id
     */
    int delete(Long id);

    /**
     * 修改收货地址
     * @param id 地址表的id
     * @param address 修改的收货地址信息
     */
    @Transactional
    int update(Long id, MemberReceiveAddress address);

    /**
     * 返回当前用户的收货地址
     */
    List<MemberReceiveAddress> list();
    /**
     * 获取地址详情
     * @param id 地址id
     */
    MemberReceiveAddress getItem(Long id);
}
